/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: 焦质晔
 * @Last Modified time: 2019-11-30 15:49:43
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 查询内部领用单
export const getList = params => axios.get(`${SERVER.MEMBERS_CLUB}/giftPick`, {
  params
});

// 查询内部领用单-待出库数据
export const getOutList = params => axios.get(`${SERVER.MEMBERS_CLUB}/giftPick/getOutList`, { params });

// 查询内部领用单-待已出库和已部分退库数据
export const getReturnList = params => axios.get(`${SERVER.MEMBERS_CLUB}/giftPick/getReturnList`, { params });

// 查询内部领用单明细
export const getDetaiList = params => axios.get(`${SERVER.MEMBERS_CLUB}/giftPick/detailList`, {
  params
});

// 添加内部领用单
export const addGiftPick = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPick`, params);

// 查询礼品
export const getStorageList = params => axios.get(`${SERVER.MEMBERS_CLUB}/clbGiftStorage/storageList`, {
  params
});

// 删除内部领用单
export const deleteById = params => axios.get(`${SERVER.MEMBERS_CLUB}/giftPick/del`, {
  params
});

// 确认及取消操作
export const confirmByIds = params => axios.get(`${SERVER.MEMBERS_CLUB}/giftPick/confirm`, {
  params
});

// 出库操作
export const outBound = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPick/outBound`, params);

// 退库操作
export const returnsGoods = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPick/returnsGoods`, params);

// 获得仓库下拉列表
export const getStorage = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/findUserControlStorageCode`, {
  params
});

// 获得部门下拉列表
export const getOrgList = params => axios.get(`${SERVER.SYSMANAGE}/org/getOrgByOrgType?orgType=15061004`, {
  params
});

// 根据orgId获得该组织下所有的人员信息(旧，有人员重复，含是一个人的不同角色数据)
export const getUserList = params => axios.get(`${SERVER.SYSMANAGE}/org/getUserByOrgId`, {
  params
});

// 根据orgId获得该组织下所有的人员信息(新，无人员重复)
export const getUserByOrgIdNew = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/positions/getUserByOrgIdNew`, { params });

// 获取内部领用单打印数据
export const getPickPrint = params => axios.get(`${SERVER.MEMBERS_CLUB}/giftPick/getPickPrint`, { params });

// 删除内部领用单明细接口
export const delPickDetail = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPick/delPickDetail`, params);
